import request from '/@/utils/request';

export function userApi() {
    return {
        page(data:Object) {
            return request({
                url: '/system/user/page',
                method: 'get',
                params:data
            })
        },
        save(data:object) {
            return request({
                url: '/system/user/save',
                method: 'post',
                data
            })
        },
        update(data:object) {
            return request({
                url: '/system/user/update',
                method: 'post',
                data
            })
        },
        del(id:string) {
            return request({
                url: '/system/user/delete',
                method: 'post',
                data: {id:id}
            })
        },
        resetUserPwd(id:string, password:string) {
            return request({
                url: '/system/user/resetPassword',
                method: 'post',
                data:{id,password}
            })
        },
        updatePassword(data:object) {
            return request({
                url: '/system/user/updatePassword',
                method: 'post',
                params: data
            })
        },
        getRoleListString(id:string) {
            return request({
                url: '/system/user/getRoleListString',
                method: 'get',
                params: {id}
            })
        },
        getPostListString(id:string) {
            return request({
                url: '/system/user/getPostListString',
                method: 'get',
                params: {id}
            })
        },
        upload : import.meta.env.VITE_API_URL + "/system/user/upload"
    }
}


